import {createRouter,createWebHistory} from 'vue-router'
import index from '@/views/Layout/index.vue'
import Home from '@/views/Home/index.vue'
import category from '@/views/Category/index.vue'
import detail from '@/views/Detail/index.vue'
import subCategory from '@/views/SubCategory/index.vue'
import Login from '@/views/login/index.vue'
import Cart from '@/views/CartList/index.vue'
const router = createRouter({
	history:createWebHistory(),
	routes:[
        {
			path:'/',
			component: index,
			children: [
				{
				path: '',
				component: Home
				},
				{
				path: '/category/:id',
				component: category
				}
			]
		},
		 {
			path:'/detail/:id',
			component: detail,
			children: [
		
			]
		},
		 {
			path:'/category/sub/:id',
			component: subCategory,
			children: [
		
			]
		},
		 {
			path:'/login',
			component: Login,
			children: [
		
			]
		},
		 {
			path:'/cart',
			component: Cart,
			children: [
		
			]
		}
	]
})
export default router